package cn.alise.qdp.service.apiException;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import cn.alise.qdp.mapper.apiException.ApiExceptionMapper;
import cn.alise.qdp.model.apiException.ApiException;

/**
 * ApiExceptionService
 * Wed Mar 13 20:55:04 CST 2019  CHENH
 */ 
@Service
@Transactional(rollbackFor = Exception.class)
public class ApiExceptionService {

	@Resource(name = "apiExceptionMapper")
	private ApiExceptionMapper apiExceptionMapper;

	/**
	 * 获取指定一条数据
	 */ 
	public ApiException get(ApiException args) {
		List<ApiException> list = this.list(args);
		if (!CollectionUtils.isEmpty(list)) {
			return list.get(0);
		}

		return null;
	}

	/**
	 * 获取列表
	 */ 
	public List<ApiException> list(ApiException args) {
		return this.apiExceptionMapper.list(args);
	}

	/**
	 * 分页列表
	 */ 
	public List<ApiException> page(Map<String, Object> args) {
		return this.apiExceptionMapper.page(args);
	}

	/**
	 * 列表总数
	 */ 
	public int total(ApiException args) {
		return this.apiExceptionMapper.total(args);
	}

	/**
	 * 删除数据
	 */ 
	public int delete(ApiException args) {
		return this.apiExceptionMapper.delete(args);
	}

	/**
	 * 更新数据
	 */ 
	public int save(ApiException args) {
		return this.apiExceptionMapper.insert(args);
	}

	/**
	 * 新增数据
	 */ 
	public int update(ApiException args) {
		return this.apiExceptionMapper.update(args);
	}

}

